package com.opal.modules.costReportForm.service.impl;

import com.opal.modules.costReportForm.entity.table.CostSignature;
import com.opal.modules.costReportForm.mapper.mysql.CostCommonMapper;
import com.opal.modules.costReportForm.service.CostCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CostCommonServiceImpl implements CostCommonService {
    @Autowired
    private CostCommonMapper costCommonMapper;
    @Override
    public int insertCostSignatureService(CostSignature costSignature) {
        //若这四个经理都等于null，证明是财务接收等情况，直接跳过
        if(costSignature.getBmjl()==null && costSignature.getXmjl()==null && costSignature.getZjl()==null &&costSignature.getZc()==null){
            return 1;
        }else{
            return costCommonMapper.insertCostSignature(costSignature);
        }

    }

    @Override
    public CostSignature selectCostSignatureBycostReportId(String costcostReportId) {
        return costCommonMapper.selectCostSignatureBycostReportId(costcostReportId);
    }

    @Override
    public int deleteCostSignatureService(String costReportId) {
        return costCommonMapper.deleteCostSignatureBycostReportId(costReportId);
    }


}
